package strategy.interfaces;

public class PricingStrategyFactory {

	private static PricingStrategyFactory instance = null;
	
	protected PricingStrategyFactory(){
		//Exists only to defeat instantiation.
	}
	
	public static PricingStrategyFactory getInstance(){
		
		if(instance == null){
			instance = new PricingStrategyFactory();
		}
		
		return instance;
	}// end getInstance
	
	
	public IDiscountPricingStrategy getDiscountPricingStrategy(String criteria){
		if ( criteria.equals("Coupon") )
		      return new CouponPricingStrategy();
		    else if ( criteria.equals("Percent") )
		      return new PercentDiscountPricingStrategy();
		
		    return null;
		    
		    //review pg 441 if you have time
	}//end getDiscountPricingStrategy
}
